package weifei.mall.entity;


import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.springframework.stereotype.Repository;


/**
 *
 * -- 用户 收货地址 表
 * CREATE TABLE user_address
 * (
 *     id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
 *     user_id INT UNSIGNED NOT NULL COMMENT "用户ID",
 *     address TEXT COMMENT "收货地址",
 *     PRIMARY KEY (id),
 *     FOREIGN KEY (user_id) REFERENCES user(id)
 * );
 *
 * */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("user_address")
@Repository
public class UserAddress extends Model<UserAddress>
{
    @Getter
    public enum Column
    {
        ID("id"),
        UserID("user_id"),
        Address("address");

        final String name;
        Column(String name) { this.name = name; }
    }

    @TableId
    private Integer id;
    private Integer userId;
    private String address;

    public UserAddress() {}
    public UserAddress(int id) {}
}



